package cn.source.system.service.impl;

import java.util.List;
import cn.source.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.source.system.mapper.TravelFacilityMapper;
import cn.source.system.domain.TravelFacility;
import cn.source.system.service.ITravelFacilityService;

/**
 * 基础设施Service业务层处理
 * 
 * @author sourcebyte.vip
 * @date 2024-06-19
 */
@Service
public class TravelFacilityServiceImpl implements ITravelFacilityService 
{
    @Autowired
    private TravelFacilityMapper travelFacilityMapper;

    /**
     * 查询基础设施
     * 
     * @param id 基础设施主键
     * @return 基础设施
     */
    @Override
    public TravelFacility selectTravelFacilityById(Long id)
    {
        return travelFacilityMapper.selectTravelFacilityById(id);
    }

    /**
     * 查询基础设施列表
     * 
     * @param travelFacility 基础设施
     * @return 基础设施
     */
    @Override
    public List<TravelFacility> selectTravelFacilityList(TravelFacility travelFacility)
    {
        return travelFacilityMapper.selectTravelFacilityList(travelFacility);
    }

    /**
     * 新增基础设施
     * 
     * @param travelFacility 基础设施
     * @return 结果
     */
    @Override
    public int insertTravelFacility(TravelFacility travelFacility)
    {
        travelFacility.setCreateTime(DateUtils.getNowDate());
        return travelFacilityMapper.insertTravelFacility(travelFacility);
    }

    /**
     * 修改基础设施
     * 
     * @param travelFacility 基础设施
     * @return 结果
     */
    @Override
    public int updateTravelFacility(TravelFacility travelFacility)
    {
        travelFacility.setUpdateTime(DateUtils.getNowDate());
        return travelFacilityMapper.updateTravelFacility(travelFacility);
    }

    /**
     * 批量删除基础设施
     * 
     * @param ids 需要删除的基础设施主键
     * @return 结果
     */
    @Override
    public int deleteTravelFacilityByIds(Long[] ids)
    {
        return travelFacilityMapper.deleteTravelFacilityByIds(ids);
    }

    /**
     * 删除基础设施信息
     * 
     * @param id 基础设施主键
     * @return 结果
     */
    @Override
    public int deleteTravelFacilityById(Long id)
    {
        return travelFacilityMapper.deleteTravelFacilityById(id);
    }
}
